﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AnLe.Helper
{
    public class StringHelper
    {
        public static void countRow(int totalVal, int numCol, ref int totalRow, ref int numInt)
        {
            try
            {
                if (totalVal % numCol == 0)
                {
                    totalRow = totalVal / numCol;
                }
                else { totalRow = (totalVal / numCol) + 1; numInt = totalVal % numCol; }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public static string GetPath(string str)
        {
            try
            {
                string strReturn = "";
                string[] arr = str.Split('\\');
                for (int i = 0; i < arr.Length; i++)
                {
                    if (arr[i] == "Uploads")
                    {
                        strReturn = "/anle//";
                        for (int j = i; j < arr.Length; j++)
                        {
                            strReturn += arr[j] + "//";
                        }
                        //  strRef = strReturn.Replace("//","/");
                        return  strReturn.Substring(0, strReturn.Length - 2);
                    }
                }
                return strReturn;

            }
            catch (Exception)
            {
                return "";
            }
        }
    }
}